Repository navigation
feat(pre-parser): check particles against the 받침 - #54
Merged
Merged
Conversation
The methods of PreParser move, unchanged, into sibling files by task: one lexer token into parser tokens (classify.rs), the verbs in 다 (verbs.rs), the declared names (names.rs). pre_parser.rs keeps the entry point, the struct and run.
…other 받침 A declaration whose particle has two forms (끝는, 나은) now gives the BadBatchim warning with the right form (끝은, 나는). expected_form picks the form from the 받침 of the last syllable: in a pair of NAME_PARTICULES, the first one follows a 받침. The pre-parser keeps its warnings in a field, so that every pass can push one, and declared_names is split into is_parameter, declared_variable and NameScan. Refs #17
…ames The BadBatchim warning now covers: - a particle after a number, against its Sino-Korean reading: the last digit, or 영 when it is 0 (십, 백… have a 받침 like it): 1를 → 1을; - a type, a keyword or a boolean with its particle: 정수을, 참예요; - every name cut with its particle, used or declared (split_name). (으)로 and 의 have no form in NAME_PARTICULES and are not checked. Refs #17
…g.sh With issues given (or found from the branch), each MISS of a checks.sh now lists its program with line numbers, then the whole stderr and the exit code of the compiler on it, instead of only the last line.
Numbers, types / keywords / booleans and declared names now share check_batchim(shown, read, written, particle, span). expected_form looks in every particle, so (으)로 after a type is checked too. WIP: the particle after `)` (Refs #17) is not done yet: it still has a debug eprintln, and 7 tests fail with UnknownIdentifier("를").
The particle after one or more `)` follows the last thing read inside: (가 + 나)를 checks 나, ((가 + 3))를 checks 3. Any other last token keeps the particle without a check, as before. Closes #17
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #17
The pre-parser now warns (
BadBatchim) when a particle with two forms is in the form of the other 받침, and names the right form.): the last thing read inside,(가 + 나)을checks 나,((가 + 3))를checks 3.All these checks go through one
check_batchim.pre_parser.rsis split intoclassify.rs,verbs.rsandnames.rs.scripts/missing.shnow shows, under each MISS of achecks.sh, the program and the whole compiler stderr.Checks
cargo fmt --check,cargo test: 1387 passedscripts/run_samples.sh: 61/61scripts/missing.sh 17: 45/45